<template>
  <div class="box2 bt">
    <div class="information functionalArea">
      <!--
      <h3 class="mb20 ml10" v-if="userInfo.userSex=='M'">
        <span class="ml10"> Dear {{userInfo.userName}} Sir!</span>
      </h3>
      <h3 class="mb20 ml10" v-if="userInfo.userSex=='F'">
        <span class="ml10">Dear {{userInfo.userName}} Lady!</span>
      </h3>
      -->
      <h3 class="mb20 ml10" >
        <span class="ml10">User Basic Infomation</span>
      </h3>
      <!--
      <p class="basic">User Basic Infomation</p>
      -->
      <el-row style="padding :0 20px">
        <el-col :span="24">
          <el-form :model="userInfo" ref="userInfo">
            <el-form-item label="Name：">
              <label>{{ userInfo.userName}}</label>
            </el-form-item>
            <el-form-item label="Role：">
              <label>{{ userInfo.roleName}}</label>
            </el-form-item>
            <el-form-item label="Last successful log on time：">
              <label> {{$tools.utils.formatDate(userInfo.lastLogonTime,{"symbol":"YYYY-MM-DD HH:mm:ss"})}}</label>
            </el-form-item>
          </el-form>
          <a class="cOrange" @click="modify" v-if="userInfo.logonType==1">修改密码</a>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      userInfo: {
        userName: "",
        lastLogonTime: "",
        userSex: "",
        roleNo:'',
        roleName:'',
        logonType:'',
      },
    }
  },
  mounted() {
    this.information()
  },

  methods: {
    information() {
      let _this = this
      //console.log("个人信息展示"+_this.$tools.storage.get("user", "save"))
      let user = _this.$tools.storage.get("user","save")
      //console.log("user:"+JSON.stringify(user))
      _this.userInfo.userName = user.userAlias
      _this.userInfo.mName = user.mName
      _this.userInfo.mPhone = user.mPhone
      _this.userInfo.lastLogonTime = user.lastLogonTime
      _this.userInfo.userSex = user.userSex
      _this.userInfo.roleNo = user.roleNo
      _this.userInfo.roleName = user.roleName
      _this.userInfo.logonType=user.logonType
    },
    modify(){
     let _this = this
     _this.$emit("modify","")
    }
  }
}

</script>
<style lang="scss">
.box2 {
  width: 30%;
  background:#fff;
}

.box2 .information {
  border: 1px solid #f1f1f1;

}

.box2 .information h3 {
  line-height: 40px;
  background: #ee6b00;
  color: #fff;
  font-size: 16px;
}

.box2 .information .set {
  position: absolute;
  top: 10px;
  right: 50px;
}

.box2 .information .basic {
  line-height: 30px;
 border-bottom: 1px solid #f1f1f1;
 padding-left:20px;
}

.box2 .information .el-form-item {
  margin-bottom: 0;
}
</style>